{% extends "analysis_plugins/general_information.html" %}

{% block analysis_result_details %}

    {% for software_data in analysis_result.software_components %}
        <tr>
            <td>{{ loop.index - 1 }}</td>
            <td class="p-0 m-0">
                <table class="table table-bordered m-0">
                    <colgroup>
                        <col style="width: 150px">
                        <col style="width: 600px">
                    </colgroup>
                    <tbody class="table-analysis">
                    <tr>
                        <td>Software Name</td>
                        <td>{{ software_data.name }}</td>
                    </tr>
                    <tr>
                        <td>Version</td>
                        <td>
                            {% if software_data.versions | length > 1 %}
                                <ul>
                                    {% for version in software_data.versions %}
                                        <li>{{ version }}</li>
                                    {% endfor %}
                                </ul>
                            {% elif software_data.versions | length == 1 %}
                                {{ software_data.versions[0] }}
                            {% else %}
                                N/A
                            {% endif %}
                        </td>
                    </tr>
                    {% if software_data.description %}
                        <tr>
                            <td>Description</td>
                            <td>{{ software_data.description }}</td>
                        </tr>
                    {% endif %}
                    {% if software_data.website %}
                        <tr>
                            <td>Website</td>
                            <td>
                                <a href="{{ software_data.website }}">{{ software_data.website }}</a>
                            </td>
                        </tr>
                    {% endif %}
                    {% if software_data.open_source != None %}
                        <tr>
                            <td>Open Source</td>
                            <td>{{ software_data.open_source }}</td>
                        </tr>
                    {% endif %}
                    <tr>
                        <td>Matched Sequence</td>
                        <td class="p-0">
                            <table class="table table-bordered table-sm m-0">
                                <tr>
                                    <th>identifier</th>
                                    <th>offset</th>
                                    <th>string</th>
                                </tr>
                                {% for string_data in software_data.matching_strings %}
                                    <tr>
                                        <td style="min-width: 120px; width: 10%;">{{ string_data.identifier }}</td>
                                        <td style="min-width: 120px; width: 10%;">{{ string_data.offset }}</td>
                                        <td>{{ string_data.string }}</td>
                                    </tr>
                                {% endfor %}
                            </table>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </td>
        </tr>
    {% endfor %}

{% endblock %}
